<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        //冒泡排序  ： 冒大泡    冒小泡

//冒大泡 : 88 66 5 4 3 2 1
//冒小泡 ： 1 2 3 4 5 66 88
        var arr = [3, 7, 2, 4, 76, 99, 33];
        for (var i = 0; i < arr.length; i++) {
            // console.log(arr[i]);
            for (var j = i + 1; j < arr.length; j++) {
                if (arr[i] > arr[j]) {
                    var brr = arr[i];
                    arr[i] = arr[j];
                    arr[j] = brr;
                }

            }
        }
        console.log(arr);
      
    </script>
</body>

</html>